package cn.iocoder.yudao.module.dify.dal.mysql.taskprocessingrecords;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.dify.dal.dataobject.taskprocessingrecords.TaskProcessingRecordsDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.dify.controller.admin.taskprocessingrecords.vo.*;

/**
 * 用户调用dify任务工作流处理记录 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface TaskProcessingRecordsMapper extends BaseMapperX<TaskProcessingRecordsDO> {

    default PageResult<TaskProcessingRecordsDO> selectPage(TaskProcessingRecordsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<TaskProcessingRecordsDO>()
                .eqIfPresent(TaskProcessingRecordsDO::getFileIdList, reqVO.getFileIdList())
                .likeIfPresent(TaskProcessingRecordsDO::getOriginalName, reqVO.getOriginalName())
                .eqIfPresent(TaskProcessingRecordsDO::getDifyRequestId, reqVO.getDifyRequestId())
                .eqIfPresent(TaskProcessingRecordsDO::getDifyDownloadUrl, reqVO.getDifyDownloadUrl())
                .eqIfPresent(TaskProcessingRecordsDO::getDifyExpiresAt, reqVO.getDifyExpiresAt())
                .eqIfPresent(TaskProcessingRecordsDO::getDifyResponse, reqVO.getDifyResponse())
                .eqIfPresent(TaskProcessingRecordsDO::getMinioUrl, reqVO.getMinioUrl())
                .eqIfPresent(TaskProcessingRecordsDO::getProcessStatus, reqVO.getProcessStatus())
                .eqIfPresent(TaskProcessingRecordsDO::getRetryCount, reqVO.getRetryCount())
                .betweenIfPresent(TaskProcessingRecordsDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(TaskProcessingRecordsDO::getType, reqVO.getType())
                .orderByDesc(TaskProcessingRecordsDO::getId));
    }

}